import time
from base.basePage import BasePage
from config import host
from page.mail_list_manager import OrgPageElements
from page.mail_list_manager import TagPageElements
from page import BasePageElements

class TagPage(BasePage):

    def create_tag(self, tag_name):
        # 进入通讯录界面
        self.my_get("{}{}".format(host, OrgPageElements.mail_list_url_path))
        # 点击-+号
        self.my_click(ele=OrgPageElements.add_button)
        # 点击-添加标签
        self.my_click(ele=TagPageElements.add_tag_button)
        # 输入标签名
        self.my_send_keys(ele=OrgPageElements.name_input, value=tag_name)
        # 点击-确定
        time.sleep(1)
        self.my_click(ele=BasePageElements.define_button)